package com.slj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.slj.model.entity.Inventory;
import com.slj.model.vo.InventoryProductVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface InventoryMapper extends BaseMapper<Inventory> {

    /**
     * 分页查询库存商品信息
     */
    List<InventoryProductVO> selectInventoryProductPage(
            @Param("productName") String productName,
            @Param("page") Page<InventoryProductVO> page);

    /**
     * 查询低于安全库存的商品信息
     */
    List<InventoryProductVO> selectBelowSafeQuantityWithProduct();

    /**
     * 批量更新库存
     */
    int batchUpdate(@Param("list") List<Inventory> inventoryList);

    /**
     * 查询低于安全库存的记录
     */
    List<Inventory> selectBelowSafeQuantity();
}